import os.path

import pygame
from pygame.sprite import Sprite

class Star(Sprite):
    def __init__(self, screen):
        super().__init__()
        self.screen = screen

        # 加载
        # 加载外星人图像并设置rect属性
        import_path = os.path.join(os.path.dirname(__file__), 'images', 'star.bmp')
        self.image = pygame.image.load(import_path)
        self.rect = self.image.get_rect()

        self.rect.x = self.rect.width
        self.rect.y = self.rect.height

        self.x = float(self.rect.x)

    def blitme(self):
        self.screen.blit(self.image, self.rect)